home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 10 / FM Towns Free Software Collection 10.iso / tos_updt / fmcity / palcom / system.m < prev   
Text File  |  1995-04-12  |  55KB  |  1,813 lines

  1. //--------------------------------------------------------------------------//
  2. //                        PALCOM V2.1 L10                        //
  3. //                             システムスクリプト                                //
  4. //                                                                            //
  5. //                                        CopyRight(C) 1994/08/15                //
  6. //                                FUJITSU PERSONAL COMPUTER SYSTEMS LIMITED    //
  7. //                                        written by C-cube Soft H.Nakamura    //
  8. //--------------------------------------------------------------------------//
  9. //##########################################################################//
  10. //###                            セットブロック                             ###//
  11. //##########################################################################//
  12. !!SETBLOCK
  13.     $$CENTER.TYPE      = [""];
  14. //    $$PRIORITY.FORE    = 10;
  15. //    $$PRIORITY.BACK    = 1;
  16.     $$PRIORITY.FORE    = 0;
  17.     $$PRIORITY.BACK    = 0;
  18. !!ENDBLOCK
  19.  
  20. //##########################################################################//
  21. //###                            ボタンブロック                             ###//
  22. //##########################################################################//
  23. !!BUTTONBLOCK
  24. //-------------------    ツールパネルのボタン設定    ------------------------//
  25. button    BTN_TRANSOPERATION    {
  26.     obj.makeButton("通信画面の操作", #TRUE, 0, 2, 546);
  27.     event    @CLICK    {
  28.         //マウスの変更
  29.         sys.pushCursor(81);
  30.         //ツールボタンの非活性化
  31.         sys.disableButton(#TRUE);
  32.         //メニューの非活性化
  33.         sys.disableMenu(#TRUE);
  34.         //通信画面の操作スクリプト起動
  35.         script.openExtern("BT_TOPER.MX", #FALSE, []);
  36.         //メニューの活性化
  37.         sys.enableMenu(#TRUE);
  38.         //ツールボタンの活性化
  39.         sys.enableButton(#TRUE);
  40.         //マウスの復元
  41.         sys.popCursor();
  42.         return;
  43.     }
  44. }
  45. button    BTN_TELCALL    {
  46.     obj.makeButton("電話をかける", #TRUE, 0, 2, 542);
  47.     event    @CLICK    {
  48.         //マウスの変更
  49.         sys.pushCursor(81);
  50.         //ツールボタンの非活性化
  51.         sys.disableButton(#TRUE);
  52.         //メニューの非活性化
  53.         sys.disableMenu(#TRUE);
  54.         //電話をかける関数呼出し
  55.         local.btn.telCall();
  56.         //メニューの活性化
  57.         sys.enableMenu(#TRUE);
  58.         //ツールボタンの活性化
  59.         sys.enableButton(#TRUE);
  60.         //マウスの復元
  61.         sys.popCursor();
  62.     }
  63. }
  64. button    DIS_BTN_TELCALL    {
  65.     obj.makeButton("電話をかける", #FALSE, 0, 2, 543);
  66. }
  67. button    BTN_TRANSFER    {
  68.     obj.makeButton( "転送" , #TRUE , 0 , 2 , 544 ) ;
  69.     event    @CLICK    {
  70.         //マウスの変更
  71.         sys.pushCursor(81);
  72.         //ツールボタンの非活性化
  73.         sys.disableButton(#TRUE);
  74.         //メニューの非活性化
  75.         sys.disableMenu(#TRUE);
  76.         //転送スクリプト起動
  77.         script.openExtern("BT_TRANS.MX", #FALSE, []);
  78.         //メニューの活性化
  79.         sys.enableMenu(#TRUE);
  80.         //ツールボタンの活性化
  81.         sys.enableButton(#TRUE);
  82.         //マウスの復元
  83.         sys.popCursor();
  84.     }
  85. }
  86. button    DIS_BTN_TRANSFER    {
  87.     obj.makeButton( "転送" , #FALSE , 0 , 2 , 545 ) ;
  88. }
  89. button    BTN_SENDBREAK    {
  90.     obj.makeButton( "" , #TRUE , 0 , 0 , 554 ) ;
  91.     event    @CLICK    {
  92.         //マウスの変更
  93.         sys.pushCursor(81);
  94.         //ブレーク信号の送信
  95.         com.sendBreak(50);
  96.         //マウスの復元
  97.         sys.popCursor();
  98.     }
  99. }
  100. button    DIS_BTN_SENDBREAK    {
  101.     obj.makeButton( "" , #FALSE , 0 , 0 , 555 ) ;
  102. }
  103. button    BTN_LINEINIT    {
  104.     obj.makeButton( "" , #TRUE , 0 , 0 , 556 ) ;
  105.     event    @CLICK    {
  106.         //マウスの変更
  107.         sys.pushCursor(81);
  108.         //ツールボタンの非活性化
  109.         sys.disableButton(#TRUE);
  110.         //メニューの非活性化
  111.         sys.disableMenu(#TRUE);
  112.         //ポートの初期化
  113.         com.initPort($$COM.PORT);
  114.         //メニューの活性化
  115.         sys.enableMenu(#TRUE);
  116.         //ツールボタンの活性化
  117.         sys.enableButton(#TRUE);
  118.         //マウスの復元
  119.         sys.popCursor();
  120.     }
  121. }
  122. button    DIS_BTN_LINEINIT    {
  123.     obj.makeButton( "" , #FALSE , 0 , 0 , 557 ) ;
  124. }
  125. button    BTN_LINECUT    {
  126.     obj.makeButton( "" , #TRUE , 0 , 0 , 553 ) ;
  127.     event    @CLICK    {
  128.         //マウスの変更
  129.         sys.pushCursor(81);
  130.         //ツールボタンの非活性化
  131.         sys.disableButton(#TRUE);
  132.         //メニューの非活性化
  133.         sys.disableMenu(#TRUE);
  134.         //回線のクローズ
  135.         local.comClose();
  136.         //ツールボタンの属性変更
  137.         obj.beginUpdateButton();
  138.         obj.setButton(0, #TRUE, "BTN_TELCALL");
  139.         obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
  140.         obj.setButton(6, #TRUE, "BTN_TELCALL");
  141.         obj.setButton(0, #TRUE, "BTN_TRANSFER");
  142.         obj.setButton(0, #TRUE, "DIS_BTN_TRANSFER");
  143.         obj.setButton(11, #TRUE, "DIS_BTN_TRANSFER");
  144.         obj.setButton(16, #TRUE, "BTN_TRANSOPERATION");
  145.         obj.setButton(0, #TRUE, "BTN_DOSCONS");
  146.         obj.setButton(21, #TRUE, "BTN_DOSCONS");
  147.         obj.setButton(0, #TRUE, "BTN_OASYS");
  148.         obj.setButton(26, #TRUE, "BTN_OASYS");
  149.         obj.setButton(0, #TRUE, "BTN_LINECUT");
  150.         obj.setButton(31, #TRUE, "DIS_BTN_LINECUT");
  151.         obj.setButton(0, #TRUE, "BTN_SENDBREAK");
  152.         obj.setButton(32, #TRUE, "DIS_BTN_SENDBREAK");
  153.         obj.setButton(0, #TRUE, "BTN_LINEINIT");
  154.         obj.setButton(33, #TRUE, "DIS_BTN_LINEINIT");
  155.         obj.setButton(0, #TRUE, "DIS_BTN_MANUTRANSEND");
  156.         obj.setButton(50, #TRUE, "BTN_MANUTRANSEND");
  157.         obj.endUpdateButton();
  158.         //メニューの活性化
  159.         sys.enableMenu(#TRUE);
  160.         //ツールボタンの活性化
  161.         sys.enableButton(#TRUE);
  162.         //マウスの復元
  163.         sys.popCursor();
  164.     }
  165. }
  166. button    DIS_BTN_LINECUT    {
  167.     obj.makeButton( "" , #TRUE , 0 , 0 , 552 ) ;
  168.     event    @CLICK    {
  169.         //マウスの変更
  170.         sys.pushCursor(81);
  171.         //ツールボタンの非活性化
  172.         sys.disableButton(#TRUE);
  173.         //メニューの非活性化
  174.         sys.disableMenu(#TRUE);
  175.         //回線のオープン
  176.         if(com.isDTR($$COM.PORT) == #FALSE) {    //オープンされていない
  177. PORTOPEN:
  178.             event.mask(@ERROR);
  179.             $ret = com.openPort($$COM.PORT, []);
  180.             //モデムの接続チェック
  181.             if($ret == #FALSE) {                //CTSがONにならない
  182.                 com.closePort($$COM.PORT);
  183.                 $backXsize = dialog.getDefaultXSize();
  184.                 dialog.setDefaultXSize(228);
  185.                 if( $$COM.PORT == -1 ) {
  186.                     $portStr = "ポート番号: 内蔵";
  187.                 } else {
  188.                     $portStr = str.join(["ポート番号:", 
  189.                                 data.toString( $$COM.PORT )], " " );
  190.                 }
  191.                 sys.popCursor();
  192.                 $ret = dialog.ask([
  193.                         "━━━━ ポートのオープン ━━━━",
  194.                         "",
  195.                         "ポートにモデムが接続されていないか",
  196.                         "モデムの電源が入っていません。",
  197.                         "",
  198.                         $portStr
  199.                         ],
  200.                        ["中断", "再実行"]);
  201.                 dialog.setDefaultXSize($backXsize);
  202.                 event.unmask(@ERROR);
  203.                 //マウスの変更
  204.                 sys.pushCursor(81);
  205.                 if($ret == 1) {
  206.                     goto PORTOPEN;
  207.                 }
  208.                 else {
  209.                     goto RETURN;
  210.                 }
  211.             }
  212.             elif($ret != #TRUE) {                //オープン失敗
  213.                 $backXsize = dialog.getDefaultXSize();
  214.                 dialog.setDefaultXSize(228);
  215.                 sys.pushCursor( 80 );
  216.                 dialog.ask([
  217.                         "━━━ ポートのオープン ━━━",
  218.                         "",
  219.                         "    回線をオープンできません。",
  220.                         ""],
  221.                        ["確認"]);
  222.                 sys.popCursor();
  223.                 dialog.setDefaultXSize($backXsize);
  224.                 goto RETURN;
  225.             }
  226.         }
  227.         //ボタンの変更
  228.         obj.beginUpdateButton();
  229.         local.btnConnectMode();
  230.         obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
  231.         obj.setButton(6, #TRUE, "BTN_TELCALL");
  232.         obj.endUpdateButton();
  233. RETURN:
  234.         //メニューの活性化
  235.         sys.enableMenu(#TRUE);
  236.         //ツールボタンの活性化
  237.         sys.enableButton(#TRUE);
  238.         //マウスの復元
  239.         sys.popCursor();
  240.     }
  241. }
  242. button    BTN_ENVSET    {
  243.     obj.makeButton( "手動通信の環境" , #TRUE , 0 , 2 , 540 ) ;
  244.     event    @CLICK    {
  245.         //マウスの変更
  246.         sys.pushCursor(81);
  247.         //ツールボタンの非活性化
  248.         sys.disableButton(#TRUE);
  249.         //メニューの非活性化
  250.         sys.disableMenu(#TRUE);
  251.         //環境設定スクリプト起動
  252.         script.openExtern("BT_EVSET.MX", #FALSE, []);
  253.         //メニューの活性化
  254.         sys.enableMenu(#TRUE);
  255.         //ツールボタンの活性化
  256.         sys.enableButton(#TRUE);
  257.         //マウスの復元
  258.         sys.popCursor();
  259.         return;
  260.     }
  261. }
  262. button    BTN_MANUTRANSEND    {
  263.     obj.makeButton( "手動通信の終了" , #TRUE , 0 , 0 , 538 ) ;
  264.     event    @CLICK    {
  265.         //マウスカ-ソルの退避/変更
  266.         sys.pushCursor(81);
  267.         //メニューの非活性化
  268.         sys.disableMenu(#TRUE);
  269.         //ボタンの非活性化
  270.         sys.disableButton(#TRUE);
  271.         //手動通信終了関数呼出し
  272.         local.manuEnd();
  273.         //@BEGIN.SYSTEMイベント発行
  274.         event.send(@BEGIN.SYSTEM, #SYSTEM, "");
  275.         return;
  276.     }
  277. }
  278. button    DIS_BTN_MANUTRANSEND    {
  279.     obj.makeButton( "手動通信の終了" , #FALSE , 0 , 0 , 539 ) ;
  280. }
  281. button    BTN_TEXTPAUSE    {
  282.     obj.makeButton( "テキストの受信保存一時停止" , #TRUE , 0 , 1 , -1 ) ;
  283.     event    @CLICK    {
  284.         //マウスカ-ソルの退避/変更
  285.         sys.pushCursor(81);
  286.         //メニューの非活性化
  287.         sys.disableMenu(#TRUE);
  288.         //ボタンの非活性化
  289.         sys.disableButton(#TRUE);
  290.         //テキスト受信一時停止関数呼出し
  291.         xfer.pauseText($$USER.DEFINED.1);
  292.         //ボタンの設定
  293.         obj.beginUpdateButton();
  294.         obj.setButton(0, #TRUE, "BTN_TEXTPAUSE");
  295.         obj.setButton(41, #TRUE, "BTN_TEXTRESTART");
  296.         obj.endUpdateButton();
  297.         //メニューの活性化
  298.         sys.enableMenu(#TRUE);
  299.         //ツールボタンの活性化
  300.         sys.enableButton(#TRUE);
  301.         //マウスの復元
  302.         sys.popCursor();
  303.     }
  304. }
  305. button    BTN_TEXTRESTART    {
  306.     obj.makeButton( "  テキストの受信保存再開  " , #TRUE , 0 , 1 , -1 ) ;
  307.     event    @CLICK    {
  308.         //マウスカ-ソルの退避/変更
  309.         sys.pushCursor(81);
  310.         //メニューの非活性化
  311.         sys.disableMenu(#TRUE);
  312.         //ボタンの非活性化
  313.         sys.disableButton(#TRUE);
  314.         //テキスト受信再開関数呼出し
  315.         xfer.resumeText($$USER.DEFINED.1);
  316.         //ボタンの設定
  317.         obj.beginUpdateButton();
  318.         obj.setButton(0, #TRUE, "BTN_TEXTRESTART");
  319.         obj.setButton(41, #TRUE, "BTN_TEXTPAUSE");
  320.         obj.endUpdateButton();
  321.         //メニューの活性化
  322.         sys.enableMenu(#TRUE);
  323.         //ツールボタンの活性化
  324.         sys.enableButton(#TRUE);
  325.         //マウスの復元
  326.         sys.popCursor();
  327.     }
  328. }
  329. button    BTN_TERMINAL    {
  330.     obj.makeButton( "" , #TRUE , 0 , 0 , 558 ) ;
  331.     event    @CLICK    {
  332.         //マウスカ-ソルの退避/変更
  333.         sys.pushCursor(81);
  334.         //メニューの非活性化
  335.         sys.disableMenu(#TRUE);
  336.         //ボタンの非活性化
  337.         sys.disableButton(#TRUE);
  338.         //端末の設定ダイアログの起動
  339.         $mxPath = str.join([$$DIR.STANDARD,"SETUP\\EV_TERMI.MX"],"" );
  340.         script.openExtern( $mxPath, #FALSE, [] );
  341.         //メニューの活性化
  342.         sys.enableMenu(#TRUE);
  343.         //ツールボタンの活性化
  344.         sys.enableButton(#TRUE);
  345.         //マウスの復元
  346.         sys.popCursor();
  347.     }
  348. }
  349. button    BTN_IDBOOK    {
  350.     obj.makeButton( "" , #TRUE , 0 , 0 , 560 ) ;
  351.     event    @CLICK    {
  352.         //マウスカ-ソルの退避/変更
  353.         sys.pushCursor(81);
  354.         //メニューの非活性化
  355.         sys.disableMenu(#TRUE);
  356.         //ボタンの非活性化
  357.         sys.disableButton(#TRUE);
  358.         //ID名簿の起動
  359.         local.btn.idbook();
  360.         //メニューの活性化
  361.         sys.enableMenu(#TRUE);
  362.         //ツールボタンの活性化
  363.         sys.enableButton(#TRUE);
  364.         //マウスの復元
  365.         sys.popCursor();
  366.     }
  367. }
  368. button    BTN_CDPG    {
  369.     obj.makeButton( "" , #TRUE , 0 , 0 , 564 ) ;
  370.     event    @CLICK    {
  371.         //マウスカ-ソルの退避/変更
  372.         sys.pushCursor(81);
  373.         //メニューの非活性化
  374.         sys.disableMenu(#TRUE);
  375.         //ボタンの非活性化
  376.         sys.disableButton(#TRUE);
  377.         //CDPGの起動
  378.         local.btn.cdpg();
  379.         //メニューの活性化
  380.         sys.enableMenu(#TRUE);
  381.         //ツールボタンの活性化
  382.         sys.enableButton(#TRUE);
  383.         //マウスの復元
  384.         sys.popCursor();
  385.     }
  386. }
  387. button    BTN_STATUSBAR    {
  388.     obj.makeButton( "" , #TRUE , 0 , 0 , 562 ) ;
  389.     event    @CLICK    {
  390.         //マウスカ-ソルの退避/変更
  391.         sys.pushCursor(81);
  392.         //メニューの非活性化
  393.         sys.disableMenu(#TRUE);
  394.         //ボタンの非活性化
  395.         sys.disableButton(#TRUE);
  396.         //ステータスバーON
  397.         $$STATUS.BAR = #TRUE;
  398.         obj.beginUpdateButton();
  399.         obj.setButton(0, #TRUE, "BTN_STATUSBAR");
  400.         obj.setButton(48, #TRUE, "DIS_BTN_STATUSBAR");
  401.         obj.endUpdateButton();
  402.         //メニューの活性化
  403.         sys.enableMenu(#TRUE);
  404.         //ツールボタンの活性化
  405.         sys.enableButton(#TRUE);
  406.         //マウスの復元
  407.         sys.popCursor();
  408.     }
  409. }
  410. button    DIS_BTN_STATUSBAR    {
  411.     obj.makeButton( "" , #TRUE , 0 , 0 , 563 ) ;
  412.     event    @CLICK    {
  413.         //マウスカ-ソルの退避/変更
  414.         sys.pushCursor(81);
  415.         //メニューの非活性化
  416.         sys.disableMenu(#TRUE);
  417.         //ボタンの非活性化
  418.         sys.disableButton(#TRUE);
  419.         //ステータスバーOFF
  420.         $$STATUS.BAR = #FALSE;
  421.         obj.beginUpdateButton();
  422.         obj.setButton(0, #TRUE, "DIS_BTN_STATUSBAR");
  423.         obj.setButton(48, #TRUE, "BTN_STATUSBAR");
  424.         obj.endUpdateButton();
  425.         //メニューの活性化
  426.         sys.enableMenu(#TRUE);
  427.         //ツールボタンの活性化
  428.         sys.enableButton(#TRUE);
  429.         //マウスの復元
  430.         sys.popCursor();
  431.     }
  432. }
  433. button    BTN_OASYS    {
  434.     obj.makeButton("OASYS文書交換" , #TRUE , 0 , 2 , 550 ) ;
  435.     event    @CLICK    {
  436.         //マウスの変更
  437.         sys.pushCursor(81);
  438.         //ツールボタンの非活性化
  439.         sys.disableButton(#TRUE);
  440.         //メニューの非活性化
  441.         sys.disableMenu(#TRUE);
  442.         //OASYS変換スクリプト起動
  443.         script.openExtern("BT_OASYS.MX", #FALSE, []);
  444.         //ツールボタンの活性化
  445.         sys.enableButton(#TRUE);
  446.         //メニューの活性化
  447.         sys.enableMenu(#TRUE);
  448.         //マウスの復元
  449.         sys.popCursor();
  450.         return;
  451.     }
  452. }
  453. button    BTN_DOSCONS    {
  454.     obj.makeButton("コンソール" , #TRUE , 0 , 2 , 548 ) ;
  455.     event    @CLICK    { local.console();    }
  456. }
  457. button    BTN_SGN_LINECUT    {
  458.     obj.makeButton( "オンラインサインアップ終了" , #TRUE , 0 , 2 , 553 ) ;
  459.     event    @CLICK    {
  460.         sys.pushCursor(81);
  461.         local.comClose();
  462.         sys.popCursor();
  463.         return;
  464.     }
  465. }
  466. //----------------------    ボタンバーのボタン設定    ------------------------//
  467. button    BUTTON51    {
  468.     obj.makeButton( " 改 行" , #TRUE , 51 , 3 , -1 ) ;
  469.     event    @CLICK    {    local.buttonBarFunc("\r");        }
  470. }
  471. button    BUTTON52    {
  472.     obj.makeButton( "   T" , #TRUE , 52 , 3 , -1 ) ;
  473.     event    @CLICK    {    local.buttonBarFunc("T\r");        }
  474. }
  475. button    BUTTON53    {
  476.     obj.makeButton( "   E" , #TRUE , 53 , 3 , -1 ) ;
  477.     event    @CLICK    {    local.buttonBarFunc("E\r");        }
  478. }
  479. button    BUTTON54    {
  480.     obj.makeButton( " 終 了" , #TRUE , 54 , 3 , -1 ) ;
  481.     event    @CLICK    {    local.buttonBarFunc("OFF\r");    }
  482. }
  483. button    BUTTON55    {
  484.     obj.makeButton( "   1" , #TRUE , 55 , 3 , -1 ) ;
  485.     event    @CLICK    {    local.buttonBarFunc("1");        }
  486. }
  487. button    BUTTON56    {
  488.     obj.makeButton( "   2" , #TRUE , 56 , 3 , -1 ) ;
  489.     event    @CLICK    {    local.buttonBarFunc("2");        }
  490. }
  491. button    BUTTON57    {
  492.     obj.makeButton( "   3" , #TRUE , 57 , 3 , -1 ) ;
  493.     event    @CLICK    {    local.buttonBarFunc("3");        }
  494. }
  495. button    BUTTON58    {
  496.     obj.makeButton( "   4" , #TRUE , 58 , 3 , -1 ) ;
  497.     event    @CLICK    {    local.buttonBarFunc("4");        }
  498. }
  499. button    BUTTON59    {
  500.     obj.makeButton( "   5" , #TRUE , 59 , 3 , -1 ) ;
  501.     event    @CLICK    {    local.buttonBarFunc("5");        }
  502. }
  503. button    BUTTON60    {
  504.     obj.makeButton( "   6" , #TRUE , 60 , 3 , -1 ) ;
  505.     event    @CLICK    {    local.buttonBarFunc("6");        }
  506. }
  507. button    BUTTON61    {
  508.     obj.makeButton( "   7" , #TRUE , 61 , 3 , -1 ) ;
  509.     event    @CLICK    {    local.buttonBarFunc("7");        }
  510. }
  511. button    BUTTON62    {
  512.     obj.makeButton( "   8" , #TRUE , 62 , 3 , -1 ) ;
  513.     event    @CLICK    {    local.buttonBarFunc("8");        }
  514. }
  515. button    BUTTON63    {
  516.     obj.makeButton( "   9" , #TRUE , 63 , 3 , -1 ) ;
  517.     event    @CLICK    {    local.buttonBarFunc("9");        }
  518. }
  519. button    BUTTON64    {
  520.     obj.makeButton( "   0" , #TRUE , 64 , 3 , -1 ) ;
  521.     event    @CLICK    {    local.buttonBarFunc("0");        }
  522. }
  523. !!ENDBLOCK
  524.  
  525. //##########################################################################//
  526. //###                            メインブロック                             ###//
  527. //##########################################################################//
  528. !!MAINBLOCK
  529. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
  530. //+++                          各種イベントハンドラ                         +++//
  531. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
  532. //-------------------------------------//
  533. //---    システムオープンイベント    ---//
  534. //-------------------------------------//
  535. event    @OPEN.SYSTEM    {
  536.     //マウスカ-ソルの退避/変更
  537.     sys.pushCursor(81);
  538.     //メニューの非活性化
  539.     sys.disableMenu(#TRUE);
  540.     //ツールボタンの非活性化
  541.     sys.disableButton(#TRUE);
  542.  
  543.     //インフォメーションパネルへの表示
  544.     printxy2( 3, 2, "パ ソ コ ン 通 信" );
  545.     printxy2( 6, 3, sys.getVersion());
  546.     //時間表示の初期設定
  547.     $SaveTime = list.getNth( time.getDate(), 5 );
  548.     $DateStr  = "";
  549.     sys.global( $DateStr  );
  550.     sys.global( $SaveTime );
  551.     local.timePrint();
  552.     sys.enableInt("local.timePrint.int");
  553.  
  554.     //ステータスバーの表示
  555.     $$STATUS.BAR = #TRUE;
  556.  
  557.     //システム変数の使用
  558.     $$USER.DEFINED.0 = 0;        //テキスト受信状態
  559.     $$USER.DEFINED.1 = -1;        //テキスト受信ファイルID
  560.     $$USER.DEFINED.2 = #FALSE;    //#TRUE:環境の変更あり #FALSE:なし
  561.     $$BIN.PROTOCOL = 3;            //プロトコルはB-Plus固定
  562.     $$BIN.AUTO.B = #FALSE;        //B-Plusの自動起動は常に行わない
  563.     $$BIN.BACK.BUTTON = #FALSE;    //バイナリ送信のバックグランド化ボタン無し
  564.     $$BBS.LOG = #FALSE;            //ログを保存しない
  565.     //自動ログ記録用変数の設定
  566.     $SysLogFileId = -1;
  567.     sys.global($SysLogFileId);
  568.  
  569.     //自動通信動作記録用変数定義
  570.     $AutoDBfileName  = "";                        // データベースファイル名
  571.     $AutoIDXfileName = "";                        // インデックスファイル名
  572.     $AutoSETfileName = "";                        // 自動通信設定ファイル名
  573.     $AutoLOGfileName = "";                        // ログファイル名
  574.     sys.global( $AutoDBfileName  );
  575.     sys.global( $AutoIDXfileName );
  576.     sys.global( $AutoSETfileName );
  577.     sys.global( $AutoLOGfileName );
  578.     sys.global( $AutoReturn      );
  579.  
  580.     //手動通信モードフラグ
  581.     $ManuTransMode = #FALSE;
  582.     sys.global( $ManuTransMode );
  583. }
  584. //-----------------------------------------//
  585. //---    起動時の自動実行処理イベント    ---//
  586. //-----------------------------------------//
  587. event    @BEGIN.SYSTEM        {
  588.     //アイコンボタンの定義
  589.     $AutoTransId    = dialog.makeButton( 0, "   自動通信   ", 514,      0 );
  590.     $ViewerId       = dialog.makeButton( 0, "文書整理/作成", 516,      0 );
  591.     $ManuTransId    = dialog.makeButton( 0, "   手動通信   ", 517,      0 );
  592.     $AutoTransSetId = dialog.makeButton( 0, "自動通信の環境", 515,      0 );
  593.     $OasysConvId    = dialog.makeButton( 0, "OASYS文書交換 ", 530,      0 );
  594.     $ManuTransSetId = dialog.makeButton( 0, "手動通信の環境", 518,      0 );
  595.     $OnlineSgnupId  = dialog.makeButton( 0, " オンラインサインアップ ", 528,      0 );
  596.     $DosConsId      = dialog.makeButton( 0, "  コンソール  ", 529,      0 );
  597.     $EndCaronId     = dialog.makeButton( 0, "     終了     ", 512, 0x801D );
  598.     $DefaultId      = $AutoTransId;
  599.  
  600.     //    ダイアログリストの作成
  601.     $DialogList = [ "メインメニュー" , 0 , -1 , -1 , $DefaultId ,
  602.                     [ "" , $AutoTransId        , [0] , [""] , [""] ] ,
  603.                     [ "" , $ViewerId        , [0] , [""] , [""] ] ,
  604.                     [ "" , $ManuTransId        , [0] , [""] , [""] ] ,
  605.                     [ "" , $AutoTransSetId    , [0] , [""] , [""] ] ,
  606.                     [ "" , $OasysConvId        , [0] , [""] , [""] ] ,
  607.                     [ "" , $ManuTransSetId    , [0] , [""] , [""] ] ,
  608.                     [ "" , $OnlineSgnupId   , [0] , [""] , [""] ] ,
  609.                     [ "" , $DosConsId        , [0] , [""] , [""] ] ,
  610.                     [ "" , $EndCaronId        , [0] , [""] , [""] ] 
  611.                   ] ;
  612.  
  613.     //メインループ
  614.     loop {
  615.         //マウスの復元
  616.         sys.popCursor();
  617.         //    ダイアログの表示
  618.         dialog.open( $DialogList );
  619.         //マウスの変更
  620.         sys.pushCursor(81);
  621.  
  622.         //    ダイアログの復帰値を取得する
  623.         $ReturnId = list.get1st( $$DIALOG.RETURN );
  624.         table( $ReturnId ) {
  625.             $AutoTransId    {local.autoTrans();}
  626.             $ViewerId        {local.viewer();}
  627.             $ManuTransId    {local.manuTrans();}
  628.             $AutoTransSetId {local.autoTransSet();}
  629.             $OnlineSgnupId    {
  630.                     //環境設定スクリプト起動
  631.                     $path = str.join([$$DIR.STANDARD,
  632.                                             "AUTO\\SCRIPT\\AUTOSGN.MX"], "" );
  633.                     script.openExtern( $path, #FALSE, []);
  634.             }
  635.             $OasysConvId    {
  636.                     //ツールボタンの非活性化
  637.                     sys.disableButton(#TRUE);
  638.                     //メニューの非活性化
  639.                     sys.disableMenu(#TRUE);
  640.                     //OASYS変換スクリプト起動
  641.                     script.openExtern("BT_OASYS.MX", #FALSE, []);
  642.                     //ツールボタンの活性化
  643.                     sys.enableButton(#TRUE);
  644.                     //メニューの活性化
  645.                     sys.enableMenu(#TRUE);
  646.             }
  647.             $ManuTransSetId {
  648.                     //ツールボタンの非活性化
  649.                     sys.disableButton(#TRUE);
  650.                     //メニューの非活性化
  651.                     sys.disableMenu(#TRUE);
  652.                     //環境設定スクリプト起動
  653.                     script.openExtern("BT_EVSET.MX", #FALSE, []);
  654.                     //メニューの活性化
  655.                     sys.enableMenu(#TRUE);
  656.                     //ツールボタンの活性化
  657.                     sys.enableButton(#TRUE);
  658.             }
  659.             $DosConsId        {local.console();}
  660.             $EndCaronId        {;}
  661.             else            {;}
  662.         }
  663.         if( ($ReturnId == $EndCaronId) || ($ReturnId < 0) ) {
  664.             //CARON終了イベントの発行
  665.             dialog.delButton( $AutoTransId ) ;
  666.             dialog.delButton( $ViewerId ) ;
  667.             dialog.delButton( $ManuTransId ) ;
  668.             dialog.delButton( $AutoTransSetId ) ;
  669.             dialog.delButton( $EndCaronId ) ;
  670.             dialog.delButton( $DosConsId ) ;
  671.             dialog.delButton( $ManuTransSetId ) ;
  672.             dialog.delButton( $OasysConvId ) ;
  673.             dialog.delButton( $OnlineSgnupId ) ;
  674.             sys.quitSystem();
  675.         }
  676.         elif($ReturnId == $ManuTransId) {
  677.             //手動通信を実行中は制御を返す
  678.             dialog.delButton( $AutoTransId ) ;
  679.             dialog.delButton( $ViewerId ) ;
  680.             dialog.delButton( $ManuTransId ) ;
  681.             dialog.delButton( $AutoTransSetId ) ;
  682.             dialog.delButton( $EndCaronId ) ;
  683.             dialog.delButton( $DosConsId ) ;
  684.             dialog.delButton( $ManuTransSetId ) ;
  685.             dialog.delButton( $OasysConvId ) ;
  686.             dialog.delButton( $OnlineSgnupId ) ;
  687.             exit;
  688.         }
  689.         list.delNth($DialogList, 5);
  690.         list.putNth($DialogList, 4, $ReturnId);
  691.     }
  692.  
  693.     //メニューの活性化
  694.     sys.enableMenu(#TRUE);
  695.     //ツールボタンの活性化
  696.     sys.enableButton(#TRUE);
  697.     //マウスの復元
  698.     sys.popCursor();
  699.  
  700.     return;
  701. }
  702. //----------------------------------------//
  703. //---   終了時の自動実行処理イベント   ---//
  704. //----------------------------------------//
  705. event    @END.SYSTEM        {
  706.     //ダイアログオープン中は無条件で終了キャンセル
  707.     if( dialog.check() == #TRUE ) {
  708.         sys.cancelQuitSystem();
  709.         return;
  710.     }
  711.  
  712.     //ボタン及びメニューの非活性化
  713.     sys.disableButton( #TRUE );
  714.     sys.disableMenu( #TRUE );
  715.  
  716.     //回線が繋がっている場合は、終了の確認を行う
  717.     if( com.isDTR( $$COM.PORT ) == #TRUE ) {
  718.         //マウスの変更
  719.         $backXsize = dialog.getDefaultXSize();
  720.         dialog.setDefaultXSize(228);
  721.         sys.pushCursor(80);
  722.         //ダイアログ表示
  723.         $rtn = dialog.ask([
  724.                 "━━━  パソコン通信の終了  ━━━",
  725.                 "",
  726.                 "   回線がつながっています。       ",
  727.                 "   終了すると回線が切断されます。 ",
  728.                 "   終了しますか?                 ",
  729.                 ""],["いいえ", "はい"]);
  730.         dialog.setDefaultXSize($backXsize);
  731.         //マウスの復元
  732.         sys.popCursor();
  733.         if( $rtn == 0 ) {
  734.             //終了を続行しない場合は終了をキャンセルする
  735.             sys.enableButton( #TRUE );
  736.             sys.enableMenu( #TRUE );
  737.             sys.cancelQuitSystem();
  738.             return;
  739.         }
  740.     }
  741. }
  742. //---------------------------------------------//
  743. //---    センタースクリプトクローズイベント    ---//
  744. //---------------------------------------------//
  745. event    @CLOSE.SCRIPT    {
  746.     //環境設定の変更確認
  747.     if($$USER.DEFINED.2) {
  748.         //マウスの変更
  749.         $backXsize = dialog.getDefaultXSize();
  750.         dialog.setDefaultXSize(228);
  751.         sys.pushCursor(80);
  752.         //ダイアログ表示
  753.         $rtn = dialog.ask([
  754.                 "━━━━━━ 環境設定 ━━━━━━",
  755.                 "",
  756.                 "環境設定の内容が編集されています。",
  757.                 "保存しますか?", ""],
  758.                  ["いいえ", "はい"]);
  759.         dialog.setDefaultXSize($backXsize);
  760.         //マウスの復元
  761.         sys.popCursor();
  762.         //環境を保存する場合、環境変数保存スクリプト起動
  763.         if($rtn == 1) {
  764.             $mxPath = str.join([$$DIR.STANDARD, "SETUP\\EV_SAVE.MX"], "");
  765.             script.openExtern($mxPath, #FALSE, []);
  766.         }
  767.         else {
  768.             $$USER.DEFINED.2 = #FALSE;
  769.         }
  770.     }
  771.  
  772.     return;
  773. }
  774. //-------------------------------------//
  775. //---    システムクローズイベント    ---//
  776. //-------------------------------------//
  777. event    @CLOSE.SYSTEM    {
  778.     //マウスの変更
  779.     sys.pushCursor(81);
  780.  
  781.     // 手動通信モードにあるなら終了させる
  782.     if ($ManuTransMode == #TRUE) {
  783.         sys.pushCursor(81);    // マウスの時計化
  784.         local.manuEnd();
  785.         sys.popCursor();    // マウスの復元
  786.     }
  787.  
  788.     //回線がオープンされていればクローズする
  789.     if( com.isDTR($$COM.PORT) == #TRUE ) {
  790.         local.comClose();
  791.     }
  792.  
  793.     //グローバルデータのローカル化
  794.     sys.deleteInt("local.timePrint.int");
  795.     sys.local($DateStr);
  796.     sys.local($SaveTime);
  797.     sys.local($SysLogFileId);
  798.     sys.local($AutoDBfileName);
  799.     sys.local($AutoIDXfileName);
  800.     sys.local($AutoSETfileName);
  801.     sys.local($AutoLOGfileName);
  802.     sys.local($AutoReturn);
  803.  
  804.     // 動作中のスクリプトを強制中断
  805.     script.stop();
  806. }
  807. //--------------------------//
  808. //---   エラーイベント   ---//
  809. //--------------------------//
  810. event    @ERROR    {
  811.     local.errorFunc();
  812.     event.mainLoop();
  813. }
  814. //------------------------------//
  815. //---   ファイル転送エラー   ---//
  816. //------------------------------//
  817. event    @ERROR.PROTOCOL {
  818.     $$ERROR.PROTOCOL = xfer.openErrorDialog(
  819.                                 list.get1st( $$ERROR.PROTOCOL    ),
  820.                                 list.getNth( $$ERROR.PROTOCOL, 2 ));
  821.     return;
  822. }
  823. //------------------------------//
  824. //---   汎用エラールーチン   ---//
  825. //------------------------------//
  826. function    local.errorFunc()    {
  827.     //---   ダイアログが出ている場合は、消す   ---//
  828.     if( dialog.check() == #TRUE ) {
  829.         dialog.close();
  830.     }
  831.  
  832.     //---   エラーダイアログの表示を行う   ---//
  833.     $error = $$ERROR;
  834.     list.delNth( $error, 6 );
  835.     list.putNth( $error, 5, ["メインループへ戻る"] );
  836.     dialog.error( $error );
  837.  
  838.     //---   メインダイアログが出るように細工する   ---//
  839.     if( script.exec?() == 2 ) {
  840.         sys.enableMenu( #FALSE );
  841.         sys.enableButton( #FALSE );
  842.         if( $ManuTransMode == #FALSE ) {
  843.             event.push( @BEGIN.SYSTEM, #SYSTEM, #MAIN, #FALSE );
  844.         }
  845.     }
  846.  
  847.     //---   マウスカーソルをとりあえず矢印に戻す   ---//
  848.     sys.changeCursor( 80 );
  849.     return;
  850. }
  851. //--------------------------------//
  852. //---   ハングアップイベント   ---//
  853. //--------------------------------//
  854. event    @TIM.HANGUP        {
  855.     //回線切断イベントの発行
  856.     event.send( @DISCONNECT, #SYSTEM, #MAIN );
  857.  
  858.     //メッセージの表示
  859.     $backXsize = dialog.getDefaultXSize();
  860.     dialog.setDefaultXSize(312);
  861.     $string = str.join([data.toString( $$TIM.HANGUP + 1 ),
  862.                         "分間操作が無かったため、回線を切断しました。"], "" );
  863.  
  864.     dialog.ask([
  865.                 "━━━━━━━━  オフタイマー  ━━━━━━━━",
  866.                 "",
  867.                 $string,
  868.                 ""],
  869.                 ["確認"]);
  870.     dialog.setDefaultXSize($backXsize);
  871. }
  872. //----------------------------//
  873. //---   回線接続イベント   ---//
  874. //----------------------------//
  875. event    @CONNECT    {
  876.     sys.disableButton(#TRUE);
  877.     obj.beginUpdateButton();
  878.     obj.setButton(0, #TRUE, "BTN_TELCALL");
  879.     obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
  880.     obj.setButton(6, #TRUE, "DIS_BTN_TELCALL");
  881.     obj.endUpdateButton();
  882.     sys.enableButton(#TRUE);
  883. }
  884. //----------------------------//
  885. //---   回線切断イベント   ---//
  886. //----------------------------//
  887. event    @DISCONNECT        {
  888.     sys.disableButton(#TRUE);
  889.     sys.pushCursor(81);
  890.     if( $ManuTransMode == #TRUE ) {
  891.         obj.beginUpdateButton();
  892.     }
  893.  
  894.     //回線のクローズ
  895.     local.comClose();
  896.  
  897.     //手動通信の時、ツールボタンの属性を変更する
  898.     if( $ManuTransMode == #TRUE ) {
  899.         obj.setButton(  0, #TRUE, "BTN_TELCALL"         );
  900.         obj.setButton(  0, #TRUE, "DIS_BTN_TELCALL"     );
  901.         obj.setButton(  6, #TRUE, "BTN_TELCALL"         );
  902.         obj.setButton(  0, #TRUE, "BTN_TRANSFER"        );
  903.         obj.setButton(  0, #TRUE, "DIS_BTN_TRANSFER"    );
  904.         obj.setButton( 11, #TRUE, "DIS_BTN_TRANSFER"    );
  905.         obj.setButton( 16, #TRUE, "BTN_TRANSOPERATION"  );
  906.         obj.setButton(  0, #TRUE, "BTN_DOSCONS"         );
  907.         obj.setButton( 21, #TRUE, "BTN_DOSCONS"         );
  908.         obj.setButton(  0, #TRUE, "BTN_OASYS"           );
  909.         obj.setButton( 26, #TRUE, "BTN_OASYS"           );
  910.         obj.setButton(  0, #TRUE, "BTN_LINECUT"         );
  911.         obj.setButton( 31, #TRUE, "DIS_BTN_LINECUT"     );
  912.         obj.setButton(  0, #TRUE, "BTN_SENDBREAK"       );
  913.         obj.setButton( 32, #TRUE, "DIS_BTN_SENDBREAK"   );
  914.         obj.setButton(  0, #TRUE, "BTN_LINEINIT"        );
  915.         obj.setButton( 33, #TRUE, "DIS_BTN_LINEINIT"    );
  916.         obj.setButton(  0, #TRUE, "DIS_BTN_MANUTRANSEND");
  917.         obj.setButton( 50, #TRUE, "BTN_MANUTRANSEND"    );
  918.         obj.endUpdateButton();
  919.     }
  920.     sys.popCursor();
  921.     sys.enableButton(#TRUE);
  922. }
  923. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
  924. //+++                            各種内部関数                             +++//
  925. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
  926. //----------------------    システムスクリプト用    ------------------------//
  927. //--------------------------------//
  928. //---   ボタンバー呼出し関数   ---//
  929. //--------------------------------//
  930. function    local.buttonBarFunc($str) {        //送信文字列
  931.     //ポートがオープンされていれば文字を送信する
  932.     if(com.isDTR($$COM.PORT) == #TRUE) {
  933.         com.putString($str, []);
  934.     }
  935.     return;
  936. }
  937. //----------------------------------//
  938. //---   時計更新用割り込み関数   ---//
  939. //----------------------------------//
  940. interrupt    local.timePrint.int( 2, 1 )    {    //インターバルタイマ割り込み(1秒毎)
  941.     $min = list.getNth( time.getDate(), 5 );
  942.     if( $min != $SaveTime ) {
  943.         $SaveTime = $min;
  944.         local.timePrint();
  945.     }
  946.  
  947.     return;
  948. }
  949. //------------------------//
  950. //---   時計表示関数   ---//
  951. //------------------------//
  952. function    local.timePrint() {
  953.     $numList = time.getDate();
  954.  
  955.     $listStr = [];
  956.     $cnt = 1;
  957.     loop {
  958.         if( $cnt == 1 ) {
  959.             $str = data.toString2( list.getNth( $numList, $cnt ), 4, "0", 0 );
  960.         } else {
  961.             $str = data.toString2( list.getNth( $numList, $cnt ), 2, "0", 0 );
  962.         }
  963.         $listStr = list.putLast( $listStr, $str );
  964.         if( $cnt == 3 ) {
  965.             $str = str.join( $listStr,"/" );
  966.             if( $DateStr != $str ) {
  967.                 $DateStr = $str;
  968.                 printxy2( 6, 6, $DateStr );
  969.             }
  970.             $listStr = [];
  971.         } elif( $cnt == 5 ) {
  972.             foreach( $a, $listStr ) {
  973.                 $b = 0;
  974.             }
  975.             $str = str.join( $listStr, ":" );
  976.             printxy2( 8, 7, $str );
  977.             exit;
  978.         }
  979.         $cnt = $cnt + 1;
  980.     }
  981. }
  982. //----------------------    メインダイアログ    ----------------------------//
  983. //---------------------//
  984. //---    自動通信    ---//
  985. //---------------------//
  986. function    local.autoTrans() {
  987.     $path = str.join([$$DIR.STANDARD, "AUTO\\SCRIPT\\AUTOMAIN.MX"], "" );
  988.     script.openExtern( $path, #FALSE, [] );
  989.     return;
  990. }
  991. //-------------------------//
  992. //---    文書整理/作成    ---//
  993. //-------------------------//
  994. function    local.viewer() {
  995.     sys.popCursor();
  996.     event.mask( @ERROR );
  997.     $rtn = mod.viewer( "", "", "", "" );
  998.     if( $rtn == #ERROR ) {
  999.         $saveXsize = dialog.getDefaultXSize();
  1000.         dialog.setDefaultXSize( 228 );
  1001.         sys.pushCursor( 80 );
  1002.         dialog.ask(["━━━━  文書整理/作成  ━━━━",
  1003.                     "",
  1004.                     "  文書整理/作成を実行できません。",
  1005.                     ""],["確認"] );
  1006.         sys.popCursor();
  1007.         dialog.setDefaultXSize( $saveXsize );
  1008.     }
  1009.     event.unmask( @ERROR );
  1010.     sys.pushCursor(81);
  1011.     return;
  1012. }
  1013. //-----------------//
  1014. //---    通信    ---//
  1015. //-----------------//
  1016. function    local.manuTrans() {
  1017.     //ツ-ルパネルにボタンを表示する
  1018.     obj.beginUpdateButton();
  1019.     obj.setButton(1, #TRUE, "BTN_ENVSET");
  1020.     obj.setButton(6, #TRUE, "BTN_TELCALL");
  1021.     obj.setButton(11, #TRUE, "DIS_BTN_TRANSFER");
  1022.     obj.setButton(16, #TRUE, "BTN_TRANSOPERATION");
  1023.     obj.setButton(21, #TRUE, "BTN_DOSCONS");
  1024.     obj.setButton(26, #TRUE, "BTN_OASYS");
  1025.     obj.setButton(31, #TRUE, "DIS_BTN_LINECUT");
  1026.     obj.setButton(32, #TRUE, "DIS_BTN_SENDBREAK");
  1027.     obj.setButton(33, #TRUE, "DIS_BTN_LINEINIT");
  1028.     obj.setButton(46, #TRUE, "BTN_TERMINAL");
  1029.     obj.setButton(47, #TRUE, "BTN_IDBOOK");
  1030.     obj.setButton(48, #TRUE, "DIS_BTN_STATUSBAR");
  1031. //    obj.setButton(49, #TRUE, "BTN_CDPG");
  1032.     obj.setButton(50, #TRUE, "BTN_MANUTRANSEND");
  1033.     obj.endUpdateButton();
  1034.  
  1035.     //手動通信モードに切り換えた
  1036.     $ManuTransMode = #TRUE;
  1037.     return;
  1038. }
  1039. //-----------------------------//
  1040. //---    自動通信環境の設定    ---//
  1041. //-----------------------------//
  1042. function    local.autoTransSet() {
  1043.     //自動通信環境設定スクリプト起動
  1044.     script.openExtern("AUTO_ENV.MX", #FALSE, []);
  1045.     return;
  1046. }
  1047. //----------------------------//
  1048. //---   DOSコンソール   ---//
  1049. //----------------------------//
  1050. function    local.console()
  1051. {
  1052.     //---   リアルメモリのチェック   ---//
  1053.     if( sys.checkMaxReal() < 1024 * 150 ) {
  1054.         $saveXsize = dialog.getDefaultXSize();
  1055.         dialog.setDefaultXSize( 324 );
  1056.         sys.pushCursor( 80 );
  1057.         dialog.ask(["━━━━━━━━━  コンソール  ━━━━━━━━━",
  1058.                     "",
  1059.                     "  拡張機能が設定されていません。                  ",
  1060.                     "  システム設定の拡張機能で「通信機能のコンソール」",
  1061.                     "を設定してください。                              ",
  1062.                     ""],["確認"] );
  1063.         sys.popCursor();
  1064.         dialog.setDefaultXSize( $saveXsize );
  1065.         return;
  1066.     }
  1067.     mod.console();
  1068.     return;
  1069. }
  1070. //----------------------    ツールパネル    ----------------------------//
  1071. //-----------------------------//
  1072. //---    手動通信の終了処理    ---//
  1073. //-----------------------------//
  1074. function    local.manuEnd() {
  1075.     //ツールパネルのボタンを非表示にする
  1076.     obj.beginUpdateButton();
  1077.     obj.setButton(0, #TRUE, "BTN_ENVSET");
  1078.     obj.setButton(0, #TRUE, "BTN_TELCALL");
  1079.     obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
  1080.     obj.setButton(0, #TRUE, "BTN_TRANSFER");
  1081.     obj.setButton(0, #TRUE, "DIS_BTN_TRANSFER");
  1082.     obj.setButton(0, #TRUE, "BTN_TRANSOPERATION");
  1083.     obj.setButton(0, #TRUE, "BTN_DOSCONS");
  1084.     obj.setButton(0, #TRUE, "BTN_OASYS");
  1085.     obj.setButton(0, #TRUE, "BTN_LINECUT");
  1086.     obj.setButton(0, #TRUE, "DIS_BTN_LINECUT");
  1087.     obj.setButton(0, #TRUE, "BTN_SENDBREAK");
  1088.     obj.setButton(0, #TRUE, "DIS_BTN_SENDBREAK");
  1089.     obj.setButton(0, #TRUE, "BTN_LINEINIT");
  1090.     obj.setButton(0, #TRUE, "DIS_BTN_LINEINIT");
  1091.     obj.setButton(0, #TRUE, "BTN_TERMINAL");
  1092.     obj.setButton(0, #TRUE, "BTN_IDBOOK");
  1093. //    obj.setButton(0, #TRUE, "BTN_CDPG");
  1094.     obj.setButton(0, #TRUE, "BTN_STATUSBAR");
  1095.     obj.setButton(0, #TRUE, "DIS_BTN_STATUSBAR");
  1096.     obj.setButton(0, #TRUE, "BTN_MANUTRANSEND");
  1097.     obj.setButton(0, #TRUE, "DIS_BTN_MANUTRANSEND");
  1098.     obj.endUpdateButton();
  1099.  
  1100.     //手動通信モードを終わった
  1101.     $ManuTransMode = #FALSE;
  1102.     return;
  1103. }
  1104. //--------------------------//
  1105. //---   ID名簿の起動   ---//
  1106. //--------------------------//
  1107. function    local.btn.idbook()
  1108. {
  1109.     $ret = mod.idBase( 0, #FALSE );
  1110.     if( $ret == #FALSE ) {
  1111.         //---   どこかで使用中である   ---//
  1112.         $saveXsize = dialog.getDefaultXSize();
  1113.         dialog.setDefaultXSize( 312 );
  1114.         sys.pushCursor( 80 );
  1115.         dialog.ask(["━━━━━━━━━  ID名簿  ━━━━━━━━━",
  1116.                     "",
  1117.                     "  ID名簿がすでに他プロセスで使用されています。",
  1118.                     "  起動中のID名簿を終了させて下さい。          ",
  1119.                     ""],["確認"] );
  1120.         sys.popCursor();
  1121.         dialog.setDefaultXSize( $saveXsize );
  1122.         return;
  1123.     }
  1124.  
  1125.     //---   取り消された   ---//
  1126.     if( list.size( $ret ) == 0 ) {
  1127.         return;
  1128.     }
  1129.  
  1130.     //---   通信中であれば、選択した内容を送信する   ---//
  1131.     if( com.isDTR( $$COM.PORT ) == #TRUE ) {
  1132.         com.putString( list.get1st( $ret ), [] );
  1133.     }
  1134.  
  1135.     return;
  1136. }
  1137. //--------------------------//
  1138. //---   CDPGの起動       ---//
  1139. //--------------------------//
  1140. function    local.btn.cdpg()
  1141. {
  1142.     $path = str.join ( [$$DIR.STANDARD,"CDPG.EXG" ] , "" );
  1143.     mod.exec( $path ,"", #TRUE );
  1144.     return;
  1145. }
  1146. //--------------------------------//
  1147. //---   手動通信モードの取得   ---//
  1148. //--------------------------------//
  1149. function    local.getManuTransMode() {
  1150.     return( $ManuTransMode );
  1151. }
  1152. //-------------------------//
  1153. //---    電話をかける       ---//
  1154. //-------------------------//
  1155. function    local.btn.telCall() {
  1156. CONTINUE_P:
  1157.     //---   電話帳スクリプトの起動   ---//
  1158.     script.openExtern("TELBOOK.MX", #FALSE, [] );
  1159.     if( $$USER.DEFINED.9 == #FALSE ) {
  1160.         //---   取消し、もしくは異常終了   ---//
  1161.         return;
  1162.     }
  1163.  
  1164.     //---   センタースクリプトの切り替え   ---//
  1165.     $envFile = list.getNth( $$USER.DEFINED.9, 6 );
  1166.     if( $envFile != "" ) {
  1167.         $centerFile = script.status( #CENTER, 1 );
  1168.         if( list.size( $centerFile ) == 0 ) {
  1169.             //---   センタースクリプトが読まれていない   ---//
  1170.             $centerFile = "";
  1171.         } else {
  1172.             $centerFile = list.get1st( $centerFile );
  1173.         }
  1174.         if( $centerFile != $envFile ) {
  1175.             event.mask( @ERROR );
  1176.             if( script.open( $envFile, #TRUE, [] ) != #TRUE ) {
  1177.                 event.unmask( @ERROR );
  1178.                 $backXsize = dialog.getDefaultXSize();
  1179.                 dialog.setDefaultXSize( 300 );
  1180.                 sys.popCursor();
  1181.                 dialog.ask([
  1182.                             "━━━━━━━━ 電話をかける ━━━━━━━━",
  1183.                             "",
  1184.                             "   環境ファイルが読み込めません。",
  1185.                             "   電話帳の「編集」で環境ファイル名を確認して",
  1186.                             " ください。", ""],
  1187.                             ["確認"]);
  1188.                 dialog.setDefaultXSize( $backXsize );
  1189.                 sys.pushCursor( 81 );
  1190.                 script.open( $centerFile, #FALSE, [] );
  1191.                 return;
  1192.             }
  1193.             event.unmask( @ERROR );
  1194.         }
  1195.     }
  1196.  
  1197.     //---   システム変数のバックアップを作成   ---//
  1198.     $telDialBackup = [$$BBS.NAME,$$BBS.TEL1,$$BBS.TEL2,$$BBS.TEL3,
  1199.                       $$BBS.REDIAL,$$BBS.REDIAL.WAIT];
  1200.  
  1201.     //---   システム変数設定   ---//
  1202.     $$BBS.TEL1        = list.getNth( $$USER.DEFINED.9, 1 );
  1203.     $$BBS.TEL2        = list.getNth( $$USER.DEFINED.9, 2 );
  1204.     $$BBS.TEL3        = list.getNth( $$USER.DEFINED.9, 3 );
  1205.     $$BBS.REDIAL      = list.getNth( $$USER.DEFINED.9, 4 );
  1206.     $$BBS.REDIAL.WAIT = list.getNth( $$USER.DEFINED.9, 5 );
  1207.  
  1208.     //---   ダイアルスクリプトを実行   ---//
  1209.     event.mask( @CONNECT );
  1210.     sys.pushCursor( 81 );
  1211.     script.openExtern("MANUDIAL.MX", #FALSE, []);
  1212.     sys.popCursor();
  1213.     event.unmask( @CONNECT );
  1214.  
  1215.     //---   システム変数を元に戻す   ---//
  1216.     $$BBS.NAME        = list.getNth( $telDialBackup, 1 );
  1217.     $$BBS.TEL1        = list.getNth( $telDialBackup, 2 );
  1218.     $$BBS.TEL2        = list.getNth( $telDialBackup, 3 );
  1219.     $$BBS.TEL3        = list.getNth( $telDialBackup, 4 );
  1220.     $$BBS.REDIAL      = list.getNth( $telDialBackup, 5 );
  1221.     $$BBS.REDIAL.WAIT = list.getNth( $telDialBackup, 6 );
  1222.  
  1223.     //---   復帰値の確認   ---//
  1224.     if( $$USER.DEFINED.9 == #TRUE ) {
  1225.         local.btnConnectMode();
  1226.     } else {
  1227.         goto CONTINUE_P;
  1228.     }
  1229.  
  1230.     return;
  1231. }
  1232. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
  1233. //+++                             通信ライブラリ関数                          +++//
  1234. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
  1235. //------------------------//
  1236. //---   回線クローズ   ---//
  1237. //------------------------//
  1238. function    local.comClose() {
  1239.     //自動ログ記録中の場合、そのファイルをクローズする
  1240.     if($SysLogFileId != -1 ) {
  1241.         xfer.endText($SysLogFileId);
  1242.         file.close($SysLogFileId);
  1243.         $SysLogFileId = -1;
  1244.     }
  1245.  
  1246.     // テキスト受信中の場合は終了する
  1247.     if($$USER.DEFINED.0 != 0) {
  1248.         xfer.endText($$USER.DEFINED.1);
  1249.         file.close($$USER.DEFINED.1);
  1250.         $$USER.DEFINED.1 = -1;
  1251.         $$USER.DEFINED.0 = 0;
  1252.         //一時停止ボタンを消去
  1253.         obj.beginUpdateButton();
  1254.         obj.setButton(0, #TRUE, "BTN_TEXTPAUSE");
  1255.         obj.setButton(0, #TRUE, "BTN_TEXTRESTART");
  1256.         obj.endUpdateButton();
  1257.         //マウスの変更
  1258.         sys.changeCursor(80);
  1259.     }
  1260.  
  1261.     //---   手動通信モードの場合は、回線クローズボタンを   ---//
  1262.     //---                 回線オープンボタンに切り替える   ---//
  1263.     if( $ManuTransMode == #TRUE ) {
  1264.         obj.beginUpdateButton();
  1265.         obj.setButton(0, #TRUE, "BTN_TELCALL");
  1266.         obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
  1267.         obj.setButton(6, #TRUE, "BTN_TELCALL");
  1268.         obj.endUpdateButton();
  1269.     }
  1270.  
  1271.     //ポートのクローズ
  1272. //    if( com.isDTR( $$COM.PORT ) == #TRUE ) {
  1273.         com.closePort($$COM.PORT);
  1274. //    }
  1275.     $$USER.DEFINED.9 = #FALSE;
  1276.  
  1277.     return;
  1278. }
  1279. //----------------------------------------------//
  1280. //---   デフォルトモデム初期化文字列の取得   ---//
  1281. //----------------------------------------------//
  1282. function    local.getDefaultInit(
  1283.     $port,                                        // ポート番号
  1284.     $ec,                                        // MNP 使用フラグ
  1285.     $hflow,                                        // ハードウェアフロー使用フラグ
  1286.     $sflow )                                    // ソフトウェアフロー使用フラグ
  1287. {
  1288.     $cmd = ["AT"];
  1289.  
  1290.     //---   デフォルト初期化コマンド   ---//
  1291.     $cmd = list.putLast( $cmd, modem.getCommand( $port, 1 ));
  1292.  
  1293.     //---   MNP の設定   ---//
  1294.     if( $ec == #TRUE ) {
  1295.         list.putLast( $cmd, modem.getCommand( $port, 13 ));
  1296.     } elif( $ec == #FALSE ) {
  1297.         list.putLast( $cmd, modem.getCommand( $port, 14 ));
  1298.     }
  1299.  
  1300.     //---   フロー制御の設定   ---//
  1301.     $sflow.on.cmd  = modem.getCommand( $port, 15 );
  1302.     $sflow.off.cmd = modem.getCommand( $port, 16 );
  1303.     $hflow.on.cmd  = modem.getCommand( $port, 17 );
  1304.     $hflow.off.cmd = modem.getCommand( $port, 18 );
  1305.     if( $hflow == #TRUE ) {
  1306.         list.putLast( $cmd, $hflow.on.cmd );
  1307.     } elif( $sflow == #TRUE ) {
  1308.         list.putLast( $cmd, $sflow.on.cmd );
  1309.     }
  1310.     if(( $hflow == #TRUE )&&( $sflow == #FALSE )) {
  1311.         if( $hflow.off.cmd != $sflow.off.cmd ) {
  1312.             list.putLast( $cmd, $sflow.off.cmd );
  1313.         }
  1314.     } elif(( $sflow == #TRUE )&&( $hflow == #FALSE )) {
  1315.         if( $sflow.off.cmd != $hflow.off.cmd ) {
  1316.             list.putLast( $cmd, $hflow.off.cmd );
  1317.         }
  1318.     } else {
  1319.         list.putLast( $cmd, $hflow.off.cmd );
  1320.         if( $sflow.off.cmd != $hflow.off.cmd ) {
  1321.             list.putLast( $cmd, $sflow.off.cmd );
  1322.         }
  1323.     }
  1324.  
  1325.     //---   コマンドをまとめて復帰する   ---//
  1326.     return( str.join( $cmd, "" ));
  1327. }
  1328. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
  1329. //+++                         自動通信環境設定関数                          +++//
  1330. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
  1331. //--------------------------------//
  1332. //---   環境ファイル読み込み   ---//
  1333. //--------------------------------//
  1334. function    local.readEnvFile($envFile) {
  1335.     //---   設定ファイルが無い場合は               ---//
  1336.     //---   現在の環境を元に設定リストを作成する   ---//
  1337.     if( file.exist( $envFile ) == #FALSE ) {
  1338.         $drive = str.left( $$DIR.STANDARD, 1 );
  1339.         if( $drive == "Q" ) {                    // CD運用時
  1340.             $saveDir = "A:\\USER";
  1341.         } else {                                // HD運用時
  1342.             $saveDir = str.join([$$DIR.STANDARD, "USER"], "");
  1343.         }
  1344.         $softFlow = $$COM.SOFT.FLOW;
  1345.         $hardFlow = $$COM.HARD.FLOW;
  1346.         if(( $softFlow == #FALSE )&&( $hardFlow == #FALSE )) {
  1347.             $hardFlow = #TRUE;
  1348.         }
  1349.         $list = [
  1350.             $$COM.PORT,                        // 接続ポート                     1
  1351.             $$COM.BAUD,                        // ボーレート                     2
  1352.             $$COM.DATA,                        // データ長                         3
  1353.             $$COM.PARITY,                    // パリティ                         4
  1354.             $$COM.SBIT,                        // ストップビット                 5
  1355.             $softFlow,                        // ハードウェアフロー             6
  1356.             $hardFlow,                        // ソフトウェアフロー             7
  1357.             $$COM.8BIT,                        // 8ビット目のマスク             8
  1358.             $$MDM.DEFAULT.INIT,                // デフォルトコマンド             9
  1359.             $$MDM.EC,                        // MNPオン/オフ                10
  1360.             $$MDM.INIT1,                    // 初期化コマンド1                11
  1361.             $$MDM.INIT2,                    // 初期化コマンド2                12
  1362.             $$MDM.INIT3,                    // 初期化コマンド3                13
  1363.             [],                                // ポート情報リスト1            14
  1364.             [],                                // ポート情報リスト2            15
  1365.             [],                                // パルス指定可/不可            16
  1366.             $$COL.TRM.CHR,                    // 通信画面文字色                17
  1367.             $$COL.TRM.BACK,                    // 通信画面背景色                18
  1368.             $$COL.EDT.CHR,                    // エディタ文字色                19
  1369.             $$COL.EDT.BACK,                    // エディタ背景色                20
  1370.             $saveDir,                        // 保存ディレクトリ                21
  1371.             "",                                // ID                            22
  1372.             "",                                // パスワード                    23
  1373.             "",                                // 市外局番                        24
  1374.             0,                                // デフォルトアクセスポイント    25
  1375.             #FALSE,                            // ユーザ設定初期化設定            26
  1376.             "",                                // シリアルナンバー                27
  1377.             "",                                // アグリーメントナンバー        28
  1378.             3,                                // リダイアル回数                29
  1379.             10,                                // リダイアル待ち時間            30
  1380.             $$COL.TRM.CUR,                    // 通信画面カーソル色            31
  1381.             $$COL.EDT.CUR,                    // エディタカーソル色            32
  1382.         ];
  1383.         return( $list );
  1384.     }
  1385.  
  1386.     //---   設定ファイルを読み込み、設定リストを作成する   ---//
  1387.     $fd = file.open( $envFile, "", 1 );
  1388.     $i = 1;
  1389.     loop {
  1390.         $str = file.getString( $fd );
  1391.         //---   ファイルが途中で終わっている?   ---//
  1392.         if( data.getType( $str ) != #STRING ) {
  1393.             file.close( $fd );
  1394.             return( #FALSE );
  1395.         }
  1396.         $str = str.replaceAll( $str, "\n", "" );
  1397.         table( $i ) {
  1398.              1    { $type = #STRING;    }            // ID
  1399.              2    { $type = #STRING;    }            // パスワード
  1400.              3    { $type = #NUMBER;    }            // ボーレート
  1401.              4    { $type = #CONST;    }            // ソフトウェアフロー制御
  1402.              5    { $type = #CONST;    }            // ハードウェアフロー制御
  1403.              6    { $type = #CONST;    }            // MNP
  1404.              7    { $type = #NUMBER;    }            // 接続ポート
  1405.              8    { $type = #CONST;    }            // デフォルトコマンド
  1406.              9    { $type = #CONST;    }            // ユーザ設定初期化コマンド
  1407.             10    { $type = #STRING;    }            // 初期化コマンド1
  1408.             11    { $type = #STRING;    }            // 初期化コマンド2
  1409.             12    { $type = #STRING;    }            // 初期化コマンド3
  1410.             13    { $type = #NUMBER;    }            // 通信画面文字色
  1411.             14    { $type = #NUMBER;    }            // 通信画面背景色
  1412.             15    { $type = #NUMBER;    }            // エディタカーソル色
  1413.             16    { $type = #NUMBER;    }            // エディタ文字色
  1414.             17    { $type = #NUMBER;    }            // エディタ背景色
  1415.             18    { $type = #NUMBER;    }            // 通信画面カーソル色
  1416.             19    { $type = #STRING;    }            // 保存ディレクトリ
  1417.             20    { $type = #STRING;    }            // 市外局番
  1418.             21    { $type = #NUMBER;    }            // デフォルトアクセスポイント
  1419.             22    { $type = #STRING;    }            // シリアルナンバー
  1420.             23    { $type = #STRING;    }            // アグリーメントナンバー
  1421.             24    { $type = #NUMBER;    }            // リダイアル回数
  1422.             25    { $type = #NUMBER;    }            // リダイアル待ち時間
  1423.         }
  1424.         table( $type ) {
  1425.             #STRING        { $data = $str;                        }
  1426.             #NUMBER        { $data = data.toNumber( $str );    }
  1427.             #CONST        {
  1428.                 if( $str == "#TRUE" ) {
  1429.                     $data = #TRUE;
  1430.                 } else {
  1431.                     $data = #FALSE;
  1432.                 }
  1433.             }
  1434.         }
  1435.         table( $i ) {
  1436.              1    { $id       = $data;    }
  1437.              2    { $password = $data;    }
  1438.              3    { $baud     = $data;    }
  1439.              4    { $softFlow = $data;    }
  1440.              5    { $hardFlow = $data;    }
  1441.              6    { $mnp      = $data;    }
  1442.              7    { $port     = $data;    }
  1443.              8    { $default  = $data;    }
  1444.              9    { $custom   = $data;    }
  1445.             10    { $init1    = $data;    }
  1446.             11    { $init2    = $data;    }
  1447.             12    { $init3    = $data;    }
  1448.             13    { $trmChr   = $data;    }
  1449.             14    { $trmBak   = $data;    }
  1450.             15    { $trmCur   = $data;    }
  1451.             16    { $edtChr   = $data;    }
  1452.             17    { $edtBak   = $data;    }
  1453.             18    { $edtCur   = $data;    }
  1454.             19    { $saveDir  = $data;    }
  1455.             20    { $cityNo   = $data;    }
  1456.             21    { $defAP    = $data;    }
  1457.             22    { $serial   = $data;    }
  1458.             23    { $agreement= $data;    }
  1459.             24    { $redial   = $data;    }
  1460.             25    { $redialw  = $data;    }
  1461.         }
  1462.         $i = $i + 1;
  1463.         if( $i == 26 ) {
  1464.             exit;
  1465.         }
  1466.     }
  1467.     file.close( $fd );
  1468.  
  1469.     //---   設定リストを生成する   ---//
  1470.     $list = [
  1471.         $port,
  1472.         $baud,
  1473.         $$COM.DATA,
  1474.         $$COM.PARITY,
  1475.         $$COM.SBIT,
  1476.         $softFlow,
  1477.         $hardFlow,
  1478.         $$COM.8BIT,
  1479.         $default,
  1480.         $mnp,
  1481.         $init1,
  1482.         $init2,
  1483.         $init3,
  1484.         [],
  1485.         [],
  1486.         [],
  1487.         $trmChr,
  1488.         $trmBak,
  1489.         $edtChr,
  1490.         $edtBak,
  1491.         $saveDir,
  1492.         $id,
  1493.         $password,
  1494.         $cityNo,
  1495.         $defAP,
  1496.         $custom,
  1497.         $serial,
  1498.         $agreement,
  1499.         $redial,
  1500.         $redialw,
  1501.         $trmCur,
  1502.         $edtCur
  1503.     ];
  1504.     return( $list );
  1505. }
  1506. //------------------------------//
  1507. //---   自動通信環境の設定   ---//
  1508. //------------------------------//
  1509. function    local.loadAutoEnv(
  1510.     $envFile,                                // 設定ファイル名
  1511.     $telNo,                                    // 電話番号
  1512.     $MNP,                                    // MNP使用可/不可
  1513.     $redialNum,                                // リダイアル回数
  1514.     $redialTime )                            // リダイアル待ち時間
  1515. {
  1516.     //---   自動通信環境の読み込み   ---//
  1517.     $rtn = local.readEnvFile( $envFile );
  1518.     if( $rtn != #FALSE ) {
  1519.         //---   変更するシステム変数の退避   ---//
  1520.         $sysValList = [$$BBS.ID, $$BBS.PASSWORD, $$COM.BAUD, $$COM.SOFT.FLOW,
  1521.             $$COM.HARD.FLOW, $$COM.PORT, $$COL.TRM.CHR, $$COL.TRM.BACK,
  1522.             $$COL.EDT.CHR, $$COL.EDT.BACK, $$CENTER.TYPE, 
  1523.             $$MDM.INIT1, $$MDM.INIT2, $$MDM.INIT3, $$MDM.DEFAULT.INIT,
  1524.             $$BIN.PROTOCOL, $$BIN.AUTO.B, $$DIR.LOG, $$TTX.NO.CODE.CONV,
  1525.             $$TIM.HANGUP, $$BBS.TEL1, $$BBS.TEL2, $$BBS.TEL3, $$MDM.EC, 
  1526.             $$BBS.REDIAL, $$BBS.REDIAL.WAIT, $$TRM.SET.RSTABLE, $$TRM.RSTABLE,
  1527.             $$MDM.CUSTOM.INIT, $$COL.TRM.CUR, $$COL.EDT.CUR, $$BBS.TYPE,
  1528.             $$TRM.EOL, $$TRM.CR.OPTION, $$TRM.KANJI.CODE
  1529.         ];
  1530.         sys.global( $sysValList );
  1531.  
  1532.         //---   システム変数の設定   ---//
  1533.         $$COM.PORT         = list.getNth( $rtn, 1 );
  1534.         $$COM.BAUD         = list.getNth( $rtn, 2 );
  1535.         $$COM.SOFT.FLOW    = list.getNth( $rtn, 6 );
  1536.         $$COM.HARD.FLOW    = list.getNth( $rtn, 7 );
  1537.         $$MDM.DEFAULT.INIT = list.getNth( $rtn, 9 );
  1538.         $$MDM.CUSTOM.INIT  = list.getNth( $rtn, 26 );
  1539.         $$MDM.INIT1        = list.getNth( $rtn, 11 );
  1540.         $$MDM.INIT2        = list.getNth( $rtn, 12 );
  1541.         $$MDM.INIT3        = list.getNth( $rtn, 13 );
  1542.         $$COL.TRM.CHR      = list.getNth( $rtn, 17 );
  1543.         $$COL.TRM.BACK     = list.getNth( $rtn, 18 );
  1544.         $$COL.TRM.CUR      = list.getNth( $rtn, 31 );
  1545.         $$COL.EDT.CHR      = list.getNth( $rtn, 19 );
  1546.         $$COL.EDT.BACK     = list.getNth( $rtn, 20 );
  1547.         $$COL.EDT.CUR      = list.getNth( $rtn, 32 );
  1548.         $$DIR.LOG          = list.getNth( $rtn, 21 );
  1549.         $$BBS.ID           = list.getNth( $rtn, 22 );
  1550.         $$BBS.PASSWORD     = list.getNth( $rtn, 23 );
  1551.         if(( $MNP == #TRUE )&&( list.getNth( $rtn, 10 ))) {
  1552.             $$MDM.EC       = #TRUE;
  1553.         }
  1554.  
  1555.         $$CENTER.TYPE      = ["NIFTY-Serve"];
  1556.         $$BIN.PROTOCOL     = 3;
  1557.         $$BIN.AUTO.B       = #FALSE;
  1558.         $$TTX.NO.CODE.CONV = #FALSE;
  1559.         $$TIM.HANGUP       = 0;
  1560.         $$BBS.TEL1         = $telNo;
  1561.         $$BBS.TEL2         = "";
  1562.         $$BBS.TEL3         = "";
  1563.         $$BBS.REDIAL       = $redialNum;
  1564.         $$BBS.REDIAL.WAIT  = $redialTime;
  1565.         $$TRM.EOL          = "\r";
  1566.         $$TRM.CR.OPTION    = "\r";
  1567.         $$TRM.KANJI.CODE   = 0;
  1568.  
  1569.         $rtn = [list.getNth( $rtn, 24 ), list.getNth( $rtn, 25 )];
  1570.     }
  1571.     return( $rtn );
  1572. }
  1573. //----------------------------------------------------------//
  1574. //---   自動通信環境の設定で変更したシステム変数の復元   ---//
  1575. //----------------------------------------------------------//
  1576. function    local.restoreAutoEnv() {
  1577.     $j = 0;
  1578.     foreach( $i, $sysValList ) {
  1579.         table($j) {
  1580.             0    { $$BBS.ID           = $i;    }
  1581.             1    { $$BBS.PASSWORD     = $i;    }
  1582.             2    { $$COM.BAUD         = $i;    }
  1583.             3    { $$COM.SOFT.FLOW    = $i;    }
  1584.             4    { $$COM.HARD.FLOW    = $i;    }
  1585.             5    { $$COM.PORT         = $i;    }
  1586.             6    { $$COL.TRM.CHR      = $i;    }
  1587.             7    { $$COL.TRM.BACK     = $i;    }
  1588.             8    { $$COL.EDT.CHR      = $i;    }
  1589.             9    { $$COL.EDT.BACK     = $i;    }
  1590.             10    { $$CENTER.TYPE      = $i;    }
  1591.             11    { $$MDM.INIT1        = $i;    }
  1592.             12    { $$MDM.INIT2        = $i;    }
  1593.             13    { $$MDM.INIT3        = $i;    }
  1594.             14    { $$MDM.DEFAULT.INIT = $i;    }
  1595.             15    { $$BIN.PROTOCOL     = $i;    }
  1596.             16    { $$BIN.AUTO.B       = $i;    }
  1597.             17    { $$DIR.LOG          = $i;    }
  1598.             18    { $$TTX.NO.CODE.CONV = $i;    }
  1599.             19    { $$TIM.HANGUP       = $i;    }
  1600.             20    { $$BBS.TEL1         = $i;    }
  1601.             21    { $$BBS.TEL2         = $i;    }
  1602.             22    { $$BBS.TEL3         = $i;    }
  1603.             23    { $$MDM.EC           = $i;    }
  1604.             24    { $$BBS.REDIAL       = $i;    }
  1605.             25    { $$BBS.REDIAL.WAIT  = $i;    }
  1606.             26    { $$TRM.SET.RSTABLE  = $i;    }
  1607.             27    { $$TRM.RSTABLE      = $i;    }
  1608.             28    { $$MDM.CUSTOM.INIT  = $i;    }
  1609.             29    { $$COL.TRM.CUR      = $i;    }
  1610.             30    { $$COL.EDT.CUR      = $i;    }
  1611.             31    { $$BBS.TYPE         = $i;    }
  1612.             32    { $$TRM.EOL          = $i;    }
  1613.             33    { $$TRM.CR.OPTION    = $i;    }
  1614.             34    { $$TRM.KANJI.CODE   = $i;    }
  1615.         }
  1616.         $j = $j + 1;
  1617.     }
  1618.     sys.local( $sysValList );
  1619.  
  1620.     return;
  1621. }
  1622. //--------------------------------------------//
  1623. //---   自動通信中断チェック割り込み関数   ---//
  1624. //--------------------------------------------//
  1625. interrupt    AUTO.interruptFunc( 2, 3 ) {
  1626.     if(( dialog.check() == #FALSE )||( com.isCD( $$COM.PORT ) == #FALSE )) {
  1627.         sys.deleteInt("AUTO.interruptFunc");
  1628.         sys.popCursor();
  1629.         event.send( @AUTO.HALT, #EXTERN, #MAIN );
  1630.     }
  1631.     return;
  1632. }
  1633. //----------------------------------//
  1634. //---   自動通信実行状態の記録   ---//
  1635. //----------------------------------//
  1636. function    local.setAutoName(
  1637.     $AutoDBfileName,                            // データベースファイル名
  1638.     $AutoIDXfileName,                            // インデックスファイル名
  1639.     $AutoSETfileName,                            // 自動通信設定ファイル名
  1640.     $AutoLOGfileName )                            // ログファイル名
  1641. {
  1642.     return;
  1643. }
  1644. //-------------------------------------------------//
  1645. //---   ツールパネルのボタンを通信中状態にする    ---//
  1646. //-------------------------------------------------//
  1647. function    local.btnConnectMode() {
  1648.     obj.beginUpdateButton();
  1649.     obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
  1650.     obj.setButton(0, #TRUE, "BTN_TELCALL");
  1651.     obj.setButton(6, #TRUE, "DIS_BTN_TELCALL");
  1652.     obj.setButton(0, #TRUE, "DIS_BTN_TRANSFER");
  1653.     obj.setButton(0, #TRUE, "BTN_TRANSFER");
  1654.     obj.setButton(11, #TRUE, "BTN_TRANSFER");
  1655.     obj.setButton(0, #TRUE, "BTN_DOSCONS");
  1656.     obj.setButton(21, #TRUE, "BTN_DOSCONS");
  1657.     obj.setButton(16, #TRUE, "BTN_TRANSOPERATION");
  1658.     obj.setButton(0, #TRUE, "BTN_OASYS");
  1659.     obj.setButton(26, #TRUE, "BTN_OASYS");
  1660.     obj.setButton(0, #TRUE, "DIS_BTN_LINECUT");
  1661.     obj.setButton(0, #TRUE, "BTN_LINECUT");
  1662.     obj.setButton(31, #TRUE, "BTN_LINECUT");
  1663.     obj.setButton(0, #TRUE, "DIS_BTN_SENDBREAK");
  1664.     obj.setButton(0, #TRUE, "BTN_SENDBREAK");
  1665.     obj.setButton(32, #TRUE, "BTN_SENDBREAK");
  1666.     obj.setButton(0, #TRUE, "DIS_BTN_LINEINIT");
  1667.     obj.setButton(0, #TRUE, "BTN_LINEINIT");
  1668.     obj.setButton(33, #TRUE, "BTN_LINEINIT");
  1669.     obj.setButton(0, #TRUE, "BTN_MANUTRANSEND");
  1670.     obj.setButton(0, #TRUE, "DIS_BTN_MANUTRANSEND");
  1671.     obj.setButton(50, #TRUE, "DIS_BTN_MANUTRANSEND");
  1672.     obj.endUpdateButton();
  1673.  
  1674.     return;
  1675. }
  1676.  
  1677. //----------------------------------------//
  1678. //---   アクセスポイントリストの取得   ---//
  1679. //----------------------------------------//
  1680. function    AUTO.getAPlist(
  1681.     $trdId,                                        // APファイルのTRD識別子
  1682.     $no )                                        // 対象TRD ID(-1:ALL)
  1683. {
  1684.     if( $no == -1 ) {
  1685.         $topTag = [-5,  -2];
  1686.     } else {
  1687.         $topTag = [$no, -2];
  1688.     }
  1689.     $apList = [];
  1690.     loop {
  1691.         //---   トップレベルのグループの読み込み   ---//
  1692.         $list = [];
  1693.         $retList = trd.getData( $trdId, $topTag );
  1694.         if( list.get1st( $retList ) != -2 ) {
  1695.             exit;
  1696.         }
  1697.         $wkList = str.split( list.getNth( $retList, 2 ), "\t" );
  1698.         list.putLast( $list, list.getNth( $wkList, 1 ));
  1699.         if( list.size( $wkList ) == 1 ) {
  1700.             list.putLast( $list, "" );
  1701.         } else {
  1702.             list.putLast( $list, list.getNth( $wkList, 2 ));
  1703.         }
  1704.         trd.getDataPush( $trdId );
  1705.  
  1706.         //---   グループ内の最初の1つのデータを取得する   ---//
  1707.         $tagNo = list.get1st( list.getLast( $retList ));
  1708.         $i = 1;
  1709.         loop {
  1710.             $tag     = [$tagNo, $i, -2];
  1711.             $retList = trd.checkList( $trdId, $tag );
  1712.             if( list.get1st( $retList ) == -2 ) {
  1713.                 $tagNoSub = list.getNth( list.getLast( $retList ), 2 );
  1714.                 exit;
  1715.             }
  1716.             $i = $i + 1;
  1717.             if( $i == 9 ) {
  1718.                 exit;
  1719.             }
  1720.         }
  1721.         if( $i == 9 ) {
  1722.             $topTag = [];
  1723.             continue;
  1724.         }
  1725.         $tag   = [$tagNo, $tagNoSub, -2];
  1726.         $retList = trd.getData( $trdId, $tag );
  1727.         list.putLast( $list, list.getNth( $retList, 2 ));
  1728.  
  1729.         //---   ボーレート、属性、電話番号の取得   ---//
  1730.         $tag   = list.getLast( $retList );
  1731.         $no    = 1;
  1732.         loop {
  1733.             list.delNth( $tag, 3 );
  1734.             list.putNth( $tag, 2, $no );
  1735.             $retList = trd.getData( $trdId, $tag );
  1736.             $data = list.getNth( $retList, 2 );
  1737.             if( $no != 3 ) {
  1738.                 $data = str.split( $data, "," );
  1739.             }
  1740.             list.putLast( $list, $data );
  1741.             $no = $no + 1;
  1742.             if( $no == 4 ) {
  1743.                 exit;
  1744.             }
  1745.         }
  1746.  
  1747.         //---   アクセスポイント1件のデータ設定   ---//
  1748.         list.putLast( $list, [$tagNo, $tagNoSub] );
  1749.         list.putLast( $apList, $list );
  1750.  
  1751.         trd.getDataPop( $trdId );
  1752.         $topTag = [];
  1753.     }
  1754.  
  1755.     return( $apList );
  1756. }
  1757.  
  1758. //------------------------------------//
  1759. //---   アクセスポイント名の取得   ---//
  1760. //------------------------------------//
  1761. function    AUTO.getApName(
  1762.     $tagNo )                                    // 対象タグNo.
  1763. {
  1764.     //---   登録アクセスポイントファイルのオープン   ---//
  1765.     $trdId = trd.init( 9120, -1 );
  1766.     $path = str.join([$$DIR.STANDARD, "PUBLIC\\APUSER.TRD"],"" );
  1767.     if( file.exist( $path ) == #FALSE ) {
  1768.         //---   ファイルが無い   ---//
  1769.         return("");
  1770.     }
  1771.     trd.load( $trdId, $path );
  1772.  
  1773.     //---   対象のAPデータの読み込み   ---//
  1774.     $apList = AUTO.getAPlist( $trdId, $tagNo );
  1775.     trd.end( $trdId );
  1776.     if( list.size( $apList ) == 0 ) {
  1777.         //---   指定のAPデータが見つからなかった   ---//
  1778.         return("");
  1779.     }
  1780.     $apList = list.get1st( $apList );
  1781.  
  1782.     //---   AP名を加工する   ---//
  1783.     $list = [];
  1784.     list.putLast( $list, list.getNth( $apList, 1 ));
  1785.     list.putLast( $list, " " );
  1786.     $wkList = list.getNth( $apList, 4 );
  1787.     list.putLast( $list, list.get1st( $wkList ));
  1788.     if( list.size( $wkList ) > 1 ) {
  1789.         list.putLast( $list, "/" );
  1790.         list.putLast( $list, list.getNth( $wkList, 2 ));
  1791.     }
  1792.     list.putLast( $list, "bps " );
  1793.     list.putLast( $list, list.getNth( $apList, 3 ));
  1794.     list.putLast( $list, " : " );
  1795.     if( list.getNth( $apList, 2 ) != "" ) {
  1796.         list.putLast( $list, list.getNth( $apList, 2 ));
  1797.         list.putLast( $list, "-" );
  1798.     }
  1799.     list.putLast( $list, list.getNth( $apList, 6 ));
  1800.     return( str.join( $list, "" ));
  1801. }
  1802.  
  1803. //----------------------------------------------//
  1804. //---   ダイアログからの復帰値の獲得/設定   ---//
  1805. //----------------------------------------------//
  1806. function    AUTO.getDialogReturn() {
  1807.     return( $AutoReturn );
  1808. }
  1809. function    AUTO.setDialogReturn( $AutoReturn ) {
  1810.     return;
  1811. }
  1812. !!ENDBLOCK
  1813.